﻿using System.ComponentModel;
using System.Web.Script.Services;
using System.Web.Services;
using Module;
using Module.QuanTriHeThong.ThietLapHeThong;

namespace HospitalManager.Webservice.QuanTriHeThong.ThietLapHeThong
{
    /// <summary>
    ///     Summary description for wsTaiKhoan_ChucVu_PhongBan
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    [ScriptService]
    public class wsTaiKhoan_ChucVu_PhongBan : WebService
    {
        private TaiKhoan_ChucVu_PhongBan _taiKhoanChucVuPhongBan = new TaiKhoan_ChucVu_PhongBan();

        [WebMethod(EnableSession = true)]
        public bool PhanQuyenTaiKhoan(string taikhoan, string makhoa, string maphongban, string machucvu)
        {
            _taiKhoanChucVuPhongBan = new TaiKhoan_ChucVu_PhongBan
            {
                TaiKhoan = taikhoan,
                MaKhoa = makhoa,
                MaPhongBan = maphongban,
                MaChucVu = machucvu
            };
            return _taiKhoanChucVuPhongBan.PhanQuyenTaiKhoan(_taiKhoanChucVuPhongBan);
        }

        [WebMethod(EnableSession = true)]
        public string SelectById(string id)
        {
            return JsonMethods.ToJsonString(_taiKhoanChucVuPhongBan.SelectById(id));
        }

        [WebMethod(EnableSession = true)]
        public bool UpdateIsActive(string id)
        {
            return _taiKhoanChucVuPhongBan.UpdateIsActive(id);
        }
    }
}